package homework;


public class MyPoint {
	double x;
	double y;
	public MyPoint(double x, double y) {
		super();
		this.x = x;
		this.y = y;
	}
	public MyPoint() {
		super();
	}
	public double getX() {
		return x;
	}
	public void setX(double x) {
		this.x = x;
	}
	public double getY() {
		return y;
	}
	public void setY(double y) {
		this.y = y;
	}
	public double distance(MyPoint secondPoint) {
		return Math.sqrt(Math.pow(this.x-secondPoint.x, 2)+Math.pow(this.y-secondPoint.y, 2));
	}
	public double distance(MyPoint p1,MyPoint p2) {
		return Math.sqrt(Math.pow(p1.x-p2.x, 2)+Math.pow(p1.y-p2.y, 2));
	}
}
